$file = $ARGV[0];
chomp($file);
open BUFF,"$file" or die "no file found\n";
#open BUFF,"test_graph1" or die "no file found\n";
$required_num_bins = $ARGV[1];
$factor = 100/$required_num_bins;
$required_num_bins1 = 100/$required_num_bins;
for($i=0;$i<$required_num_bins;$i++)
{
	$hash{$i} =0;
}
while($line = <BUFF>)
{
	chomp($line);
	$line =~ s/\s+/\t/g;
	$line =~ s/\t+/\t/g;
	#print $line."\n";
	if($line =~ m/\d/)
	{
		@array = split(/\t/,$line);
		$percent = $array[@array-1];
		$percent = $percent/$required_num_bins1;
		#$val = sprintf("%.0f", $percent);
		@ar = split(/\./,$percent);
		$val = $ar[0];
		#print $percent."\t".$val."\n";
		$hash{$val}++; 
	}
}
foreach $key (sort {$a<=>$b} keys %hash) {
	$key1 = $key+1;
     $key2 = $key*$factor;
	$key3 =$key1*$factor;
	
	print "$key $key2 - $key3= $hash{$key}\n";
}
